package com.techventus.locations;


import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
//import android.widget.Toast;

public class ListMaster extends ListActivity {
    /** Called when the activity is first created. */

	@Override
	public void onCreate(Bundle savedInstanceState) {
	  super.onCreate(savedInstanceState);
	  setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ); 
	  setListAdapter(new ArrayAdapter<String>(this,
	          android.R.layout.simple_list_item_1, COUNTRIES));
	  getListView().setTextFilterEnabled(true);

	  
	}
	

	 static final String[] COUNTRIES = new String[] {
		    "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
		    "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
		    "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
		    "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
		    "Belize", "Benin", "Bermuda", "Bhutan"
		  };

	 @Override
	 protected void onListItemClick(ListView  l, View  v, int position, long id){
		// System.out.println((String) getListView().getItemAtPosition(position));
		
		 if(position == 2){
			 Intent myIntent = new Intent(ListMaster.this,LocationMap.class);
			 ListMaster.this.startActivity(myIntent);
		 }else{
			 
			 if(position ==3){
				 Intent myIntent = new Intent(ListMaster.this,RowTest.class);
				 ListMaster.this.startActivity(myIntent);
			 }else{
				 
				 if(position ==4){
					 Intent myIntent = new Intent(ListMaster.this,NewLocation.class);
					 ListMaster.this.startActivity(myIntent);
				 }else{
				 
		 
					 	Intent myIntent = new Intent(ListMaster.this, LocationsMenu.class);
					 	ListMaster.this.startActivity(myIntent);
			 }}
		 }
		 
		 
		//System.out.println("Post");
	 }
}